package cn.wolfcode.luowowo.acticle.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter

public class TravelQuery extends QueryObject {
    private Long destId = -1L;
    private int perExpendType = -1;//平均消费
    private int travelTimeType = -1;//出发时间
    private int dayType = -1;//旅游时间
    private int orderType = 1;//排序 默认1最新 2最热

    public String getOrderBy(){
        return orderType == 1 ? "t.createTime desc" : "t.viewnum desc";
    }

    //人均消费范围对象
    public TravelCondition getPerExpend(){
        return TravelCondition.TRAVEL_PER_EXPEND.get(perExpendType);
    }

    //出发时间
    public TravelCondition getTravelTime(){
        return TravelCondition.TRAVEL_TIME.get(travelTimeType);
    }

    //旅游时间
    public TravelCondition getDay(){
        return TravelCondition.TRAVEL_DAYS.get(dayType);
    }
}
